<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-block">
          <?php
          if($this->session->flashdata('notice')){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Filed!</strong> <?php print $this->session->flashdata('notice')?>
          </div>
          <?php
          }
          if($this->session->flashdata('success')){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Success!</strong> <?php print $this->session->flashdata('success')?>
          </div>
          <?php
          }
          if($this->session->flashdata('extent')){
          ?>
          <div class="alert alert-info fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Warning!</strong> <?php print $this->session->flashdata('extent')?>
          </div>
          <?php
          }
          ?>
          <div class="widget-head">
            <h5><?=$title_table?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?=  site_url("outlet/add-new") ?>"><i class="icon-plus"></i> Add New</a></li>
                <li><a href="<?=  site_url("outlet/pos") ?>"><i class="icon-plus"></i> POS</a></li>
				<li><a href="<?=  site_url("outlet/pos-option") ?>"><i class="icon-plus"></i> POS Outlet Option</a></li>
				 <li><a href="<?=  site_url("outlet/pos-select") ?>"><i class="icon-plus"></i> POS Outlet Select</a></li>
<!--                <li><a href="#"><i class="icon-ok"></i> Active</a></li>
                <li><a href="#"><i class="icon-minus-sign"></i> No-Active</a></li>
                <li><a href="#"><i class="black-icons pdf_document"></i> Export to PDF</a></li>-->
                <li><a href="<?=  site_url("outlet/export-xls") ?>"><i class="black-icons excel_document"></i> Export to XLS</a></li>
              </ul>
            </div>
          </div>
          <div class="widget-content">
            <div class="widget-box">
              <table class="data-tbl-boxy table">
                <thead>
                  <tr>
                    <th>No</th>
                    <th>Name</th>
                    <th>Kota</th>
                    <th>Telp</th>
                    <th>Email</th>
                    <th>Status</th>
                    <th>Option</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  if(is_array($data)){
                    foreach ($data as $key => $value) {
                      if($value->id_status_outlet == 0)
                        $status = "<span class='label label-success'>Active</span>";
                      else if(($value->id_status_outlet == 1))
                        $status = "<span class='label label-important'>No Active</span>";
                      else if(($value->id_status_outlet == 2))
                        $status = "<span class='label label-important'>Development</span>";
                        
                      $link_edit = site_url("outlet/add-new/".$value->id_outlet);
                      $link_delete = site_url("outlet/delete/".$value->id_outlet);
                      $link_pendapatan = site_url("outlet/pendapatan-lain/pendapatan-lain-outlet/".$value->id_outlet);
                      $link_management = site_url("outlet/management-organisasi/".$value->id_outlet);
                      $link_pic = site_url("outlet/pic-users/".$value->id_outlet);
                      $link_opex = site_url("outlet/opex/opex-outlet/".$value->id_outlet);
                      print <<<EOD
                  <tr>
                    <td>{$value->no_outlet}</td>
                    <td>{$value->name}</td>
                    <td>{$value->kota}</td>
                    <td>{$value->telp}</td>
                    <td>{$value->email}</td>
                    <td>{$status}</td>
                    <td>
                      <div class="btn-group">
                        <button data-toggle="dropdown" class="btn btn-small dropdown-toggle">Action<span class="caret"></span></button>
                        <ul class="dropdown-menu">
                          <li><a href="{$link_edit}">Edit</a></li>
                          <li><a href="{$link_delete}">Delete</a></li>
                          <li class="divider"></li>
                          <li><a href="{$link_pic}">PIC</a></li>
                          <li><a href="{$link_management}">Management Organisasi</a></li>
                          <li><a href="{$link_opex}">Opex</a></li>
                          <li><a href="{$link_pendapatan}">Pendapatan Lain</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
EOD;
                    }
                  }
                  ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>